<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\datetime\DateTimePicker;

/* @var $this yii\web\View */
/* @var $model backend\modules\marketing\models\Coupon */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="coupon-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'coupon_name')->textInput(['maxlength' => true]) ?>
    <span style="font-weight: bold">开始时间</span>
    <?=    DateTimePickeR::widget([
        'language' => 'zh-CN',
        'model' => $model,
        'type' => DateTimePicker::TYPE_COMPONENT_APPEND,
        'attribute' => 'start_time',
        'options' => ['class' => 'input-sm'],
        'pluginOptions' => [
            'autoclose' => true,
            'format' => 'yyyy-mm-dd',
            'minView' => 'month',
        ]])?>
    <span style="font-weight: bold">结束时间</span>
    <?=    DateTimePickeR::widget([
        'language' => 'zh-CN',
        'model' => $model,
        'type' => DateTimePicker::TYPE_COMPONENT_APPEND,
        'attribute' => 'end_time',
        'options' => ['class' => 'input-sm'],
        'pluginOptions' => [
            'autoclose' => true,
            'format' => 'yyyy-mm-dd',
            'minView' => 'month',
        ]])?>

    <?= $form->field($model, 'coupon_number')->textInput() ?>

    <?= $form->field($model, 'coupon_money')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'coupon_mustmoney')->textInput(['maxlength' => true]) ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
